package com.sjg.sys.entity;

import java.util.List;
import java.util.Map;

/**
 * 分页实体类
 * @param <T>
 */
public class SysPage<T> {
	/*当前页*/
	private Integer curPage=1;
	/*当前页索引*/
	private Integer offSet;
	/*页行数*/
	private Integer pageSize=10;
	/*总行数*/
	private Integer rowsCount;
	/*总页数*/
	private Integer pageCount;
	/*数据项列表*/
	private List<T> rows;
	/*列配置*/
	private List<SysPageCol> cols;
	/*查询条件实体类*/
	private T pojo;
	/*查询条件map在查询实体类无法支持时使用*/
	private Map dto;


	public Integer getCurPage() {
		return curPage;
	}

	public void setCurPage(Integer curPage) {
		this.curPage = curPage;
	}

	public Integer getOffSet() {
		return offSet=(this.curPage-1)*this.pageSize;
	}

	public void setOffSet(Integer offSet) {
		this.offSet = offSet;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getRowsCount() {
		return rowsCount;
	}

	public void setRowsCount(Integer rowsCount) {
		this.rowsCount = rowsCount;
	}

	public Integer getPageCount() {
		return pageCount= this.rowsCount/this.pageSize+1;
	}

	public void setPageCount(Integer pageCount) {
		this.pageCount =pageCount;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public List<SysPageCol> getCols() {
		return cols;
	}

	public void setCols(List<SysPageCol> cols) {
		this.cols = cols;
	}

	public T getPojo() {
		return pojo;
	}

	public void setPojo(T pojo) {
		this.pojo = pojo;
	}

	public Map getDto() {
		return dto;
	}

	public void setDto(Map dto) {
		this.dto = dto;
	}
}
